<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>

	<body>
		<script>
			//数组去重1
			var arr = [1, 2, 2, 1, 3, 3, 4, 5, 4, 5];
			var arr1 = [];
			for(var i = 0; i < arr.length; i++) {
				if(!arr1.includes(arr[i])) {
					arr1.push(arr[i]);
				}
			}
			console.log(arr1);

			//数组去重2
			var arr2 = [1, 1, 2, 2, 3, 3, 4, 4, 5, 5];
			var arr3 = [];
			for(var i = 0; i < arr2.length; i++) {
				if(arr3.indexOf(arr2[i]) < 0) {
					arr3.push(arr2[i]);
				}
			}
			console.log(arr3);
		</script>
	</body>

</html>